Steering Clear of Triples: Deriving the Control Flow Graph Directly from the Abstract Syntax Tree in C Programs
نویسنده
چکیده
This article explores the extension of Morgenthaler's Virtual Control Flow techniqueeMor97], which derives control owwASU86] semantics directly from the Abstract Syntax Tree, from the relatively coarse granularity of syntactic C expressions to the ner granularity of basic block expressions, that is, expressions without embedded control ow. We explain why this is a better level of abstraction for program analysis, and discuss the elements of an eecient and elegant solution, motivating the presentation by appealing to a more explicit intermediate form. We present our algorithm, and conclude with remarks about the suitability of Morgenthaler's version of Virtual Control Flow for customary exhaustive data-ow analysis.
منابع مشابه
Source Code Verification for Embedded Systems using Prolog
System relevant embedded software needs to be reliable and, therefore, well tested, especially for aerospace systems. A common technique to verify programs is the analysis of their abstract syntax tree (AST). Tree structures can be elegantly analyzed with the logic programming language Prolog. Moreover, Prolog offers further advantages for a thorough analysis: On the one hand, it natively provi...
متن کاملPointer Analysis for C programs through AST traversal
We present a pointer analysis algorithm designed for source-to-source transformations. Existing techniques for pointer analysis apply a collection of inference rules to a dismantled intermediate form of the source program, making them difficult to apply to source-to-source tools that generally work on abstract syntax trees to preserve details of the source program. Our pointer analysis algorith...
متن کاملStreamlining Control Flow Graph Construction with DCFlow
A control flow graph (CFG) is used to model possible paths through a program, and is an essential part of many program analysis algorithms. While programs to construct CFGs can be written in metaprogramming languages such as Rascal, writing such programs is currently quite tedious. With the goal of streamlining this process, in this paper we present DCFlow, a domain-specific language and Rascal...
متن کاملLecture Notes on Intermediate Representation 15-411: Compiler Design
In this lecture we discuss the “middle end” of the compiler. After the source has been parsed we obtain an abstract syntax tree, on which we carry out various static analyses to see if the program is well-formed. In the L2 language, this consists of checking that every finite control flow path ends in a return statement, that every variable is initialized before its use along every control flow...
متن کاملTaming Control Flow: A Structured Approach to Eliminating Goto Statements
1994 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must be obtained from the IEEE. Abstract In designing optimizing and parallelizing compilers, ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1998